export const useDeboucedRef = (value: any, delay: number = 200) => {
  let timeoutId: any;
  return customRef((track, trigger) => {
    return {
      get: () => {
        track();
        return value;
      },
      set: (newValue) => {
        clearTimeout(timeoutId);
        timeoutId = setTimeout(() => {
          value = newValue;
          trigger();
        }, delay);
      },
    };
  });
};
